$(function()
{
        fan();
        lunbo();
        change();
        sexoption();
        changebg();
        changeimg1();
        changeimg2();

     //
        var $centent1=$('.centent1');
        var $centent1_left=$('.centent1_left');
        var $info=$('.info');
        $info.find('.info_pic').mouseover(function(event) {

            $(this).css({
                   "border":"1px solid #ccc",
                "boxShadow":"0 0 10px rgba(0,0,0,0.5)"
            })
        });
        $info.find('.info_pic').mouseout(function(event) {

            $(this).css({
                   "border":"none",
                "boxShadow":"0 0 0px rgba(0,0,0,0.5)"
            })
        });

        $('.centent1_left > div').eq(1).find('.centent1_left_lunbo').mouseover(function()
        {
            alert('safas');
        })


        $('.tui').mouseover(function()
        {
            $(this).css("background","#8F89A3");
        })
         $('.tui').mouseout(function(){
             $(this).css("background","#393939");
        })



        $('.bannar').find('.host').mouseover(function(event) {
            $(this).css("background","#8F89A3")
        });
        $('.bannar').find('.host').mouseout(function(event) {
            $(this).css("background","#393939")
        });
})
// 翻页效果
function fan()
{
    var ali=$('.bd-box li');
    var span1=$('.bd-box li .span1');
    var span2=$('.bd-box li .span2');

    ali.each(function(index)
    {
        $(this).mouseover(function()
        {
            span1.eq(index).stop();
                        span2.eq(index).stop();

            span2.eq(index).css({zIndex:1}).animate({
                top:42,
                height:0
            },80,'',function()
            {
                $(this).hide();
                span1.eq(index).css({zIndex:2}).animate({
                    top:0,
                    height:85
                },80)
            })
        })

        $(this).mouseout(function()
        {
           span1.eq(index).stop();
                        span2.eq(index).stop();
            span1.eq(index).css({zIndex:2}).animate({
                top:42,
                height:0
            },80,'',function()
            {
                $(this).hide();
                span2.eq(index).show().css({zIndex:1}).animate({
                    top:0,
                    height:85
                },80)
            })
        })
    })
}
// 轮播
function lunbo()
{
    var sWidth=$('.main_right .banner').width();
    var len=$('.main_right .banner ul li').length;

    var index=0;
    var PciTimer;

    $('.main_right .banner').mouseover(function()
    {

        $('.arron').show();
    })
    $('#left').mouseover(function()
    {

        $('.arron').show();
    })
     $('#right').mouseover(function()
    {

        $('.arron').show();
    })
    $('.main_right .banner ').mouseout(function()
    {

        $('.arron').hide();
    })

    $('.bottom span').each()
    $("#bottom span").mouseenter(function() {
        index = $("#bottom  span").index(this);
        showPics(index);
    }).eq(0).trigger("mouseenter");

    //上一页
    $('#left').click(function()
    {
        index-=1;
        if(index==-1)
        {
            index=len-1;

        }
        showPics(index);
    })

    // 下一页
    $('#right').click(function()
    {

        index+=1;
        if(index==len){
            index=0;
        }
        showPics(index);
    })
    // 自动
    $(".main_right .banner ").hover(function() {
        clearInterval(picTimer);
    },function() {
        picTimer = setInterval(function() {
            showPics(index);
            index++;
            if(index == len) {index = 0;}
        },4000); //此4000代表自动播放的间隔，单位：毫秒
    }).trigger("mouseleave");


    function showPics(index)
    {
        var nowleft=-index*sWidth;
        $('.main_right .banner ul').stop(true,false).animate({"left":nowleft},300);
        $('.main_right #bottom span').removeClass('on').eq(index).addClass('on');
    }

}



//
function change()
{
    $('#box').mouseover(function(event) {

        $(this).css({"boxShadow":"0 0 10px rgba(0,0,0,0.3)"});
       // $(this).find('.banner_bottom_right_box_img img').css("width","80px");

    });

    $('#box').find('.banner_bottom_right_box_img img').hover(function()
    {
        $(this).css({
            "width":"80px"

        });
        // $(this).parent().css({
        //     $(this)"boxShadow":"-3 0 30px rgba(0,0,0,0.7)"
        // })

    },function()
    {

        $(this).css({
            "width":"70px",
            "boxShadow":"0 0 0px rgba(0,0,0,0.3)"
        });
    })
    $('#box').mouseout(function(event) {
         $(this).css({"boxShadow":"0 0 10px rgba(255,255,255,0.3)"});

    });
}

// sex专区

function sexoption()
{
    $('.centent1_left_option .sex').find('.boy').click(function(event) {
        $(this).addClass('yes').siblings().removeClass('yes');
        $('.up').hide().siblings().show();

    });
    $('.centent1_left_option .sex').find('.girl').click(function(event) {
        $(this).addClass('yes').siblings().removeClass('yes');
        $('.on').hide().siblings().show();
    });

    $('.on li').mouseover(function(event) {

       $(this).css({
        "border":"1px solid #ccc",
        "boxShadow":"0 0 10px rgba(0,0,0,0.5)"
       })
    });

    $('.on li').mouseout(function(event) {

       $(this).css({
        "border":"none",
        "boxShadow":"0 0 0px rgba(0,0,0,0.5)"
       })
    });
      $('.up li').mouseover(function(event) {

       $(this).css({
        "border":"1px solid #ccc",
        "boxShadow":"0 0 10px rgba(0,0,0,0.5)"
       })
    });

    $('.up li').mouseout(function(event) {

       $(this).css({
        "border":"none",
        "boxShadow":"0 0 0px rgba(0,0,0,0.5)"
       })
    });
}


//// 移入图片放大
function changebg()
{
    $('.centent5_left').mouseover(function()
    {
        $(this).css("background","#fffaf4").find('.centent5_left_box').css("background","#fffaf4").find('.imgbox').find('img').css({
        "width":"250px",
        "height":"320px",
        "marginLeft":"-20px",
        "marginTop":"-20px"
    });
    })
    $('.centent5_left').mouseout(function()
    {
        $(this).css("background","#E3E1E9").find('.centent5_left_box').css("background","#E3E1E9").find('.imgbox').find('img').css({
        "width":"210px",
        "height":"280px",
        "marginLeft":"0px",
        "marginTop":"0px"
    });
    })


}


function changeimg1()
{


    $('.child').mouseover(function()
        {
            $(this).css({
                 "border":"1px solid #ccc",
                 "boxShadow":"0 0 10px rgba(0,0,0,0.4)"
            }).find('i').find('img').css({
                 "width":"150px",
        "height":"200px",
        "marginLeft":"-20px",
        "marginTop":"-20px"
            })
        })

    $('.child').mouseout(function()
        {
            $(this).css({
                 "border":"none",
                 "boxShadow":"0 0 0px rgba(0,0,0,0.4)"
            }).find('i').find('img').css({
                "width":"112px",
        "height":"160px",
        "marginLeft":"0px",
        "marginTop":"0px"
            })
        })


}


function changeimg2()
{


    $('.author_no').mouseover(function()
        {
            $(this).css({
                 "border":"1px solid #ccc",
                 "boxShadow":"0 0 10px rgba(0,0,0,0.4)"
            })
        })

    $('.author_no').mouseout(function()
        {
            $(this).css({
                 "border":"none",
                 "boxShadow":"0 0 0px rgba(0,0,0,0.4)"
            })
        })


}














































